<?php
/**
 * 对象作为参数或者赋值 参数是对象的标识,是同一个对象
 */
class User {
    public  $name = 'lisi';
}

function test($user){
    $user->name = 'zhangsan';
    echo $user->name, "\n";
}

$user = new User();

test($user);

echo $user->name, "\n"; //输出zhangsan

